class ProjectSnapshot < ActiveRecord::Base
  belongs_to :project
  #custom the values for the attachment_fu plugin

  has_attachment :content_type=>:image,
                 :storage=>:file_system,
                 :max_size=>2.megabytes,
                 #:resize_to=>[200,320],
                 :thumbnails=>{:small=>[80,60],:middle=>[160,120]},
                 :processor =>:MiniMagick
  #default validations for the attachment
  validates_as_attachment
  #validate :attachment_valid?

#  def attachment_valid?
#    unless self.filename
#     errors.add_to_base("No image file was selected" )
#    end
#    content_type = attachment_options[:content_type]
#     unless content_type.nil? || content_type.include?(self.content_type)
#     errors.add_to_base("image content type must an image" )
#    end
#    size = attachment_options[:size]
#     unless size.nil? || size.include?(self.size)
#     errors.add_to_base("image must be 1MB or less" )
#    end
#  end
end
